<?php

//print_r($data);
//实例化redis
$id=$_GET['id'];
$redis = new Redis();
//连接
$redis->pconnect("127.0.0.1",6379);
//指定库
$redis->select("15");
//判断
if($redis->Exists("num$id"))
{
    //取出数据
    $num=$redis->Get("num$id");
    $number=$num+1;
    //在建立redis
    $redis->Set("num$id",$number);
}
//建立redis数据
$redis->Set("num$id",0);
?>





<center>
    <h2>您已查看此商品第<span style="color: red"><?php echo isset($number)?$number+1:1  ?></span>次了!!!</h2>
    <h4>商品图片:<img src="<?php echo $data['goods_img']?>" alt="" width="100px" height="100px"></h4>
    <h4>商品名称:<?php echo $data['goods_name']?></h4>
    <h4>商品价格:<?php echo $data['goods_price']?></h4>
    <h4>商品库存:<?php echo $data['goods_stock']?></h4>
</center>